package com.example.demo;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * @创建人 Mr.Yan
 * @创建时间 2018/9/3
 * @描述:
 */
public class res {

    public static  void main (String  [] args) throws IOException {

        String jarFilePath = res.class.getProtectionDomain().getCodeSource().getLocation().getFile();
// URL Decoding
        jarFilePath = java.net.URLDecoder.decode(jarFilePath, "UTF-8");
        Properties config = new Properties();

        String filePath = res.class.getResource("/").getPath();
        String fileName = "register.properties";


        FileOutputStream oFile = new FileOutputStream(filePath + "/" + fileName, true);//true表示追加打开
        config.setProperty("phone", "10086");
        config.store(oFile, "\n The New properties file");

    }
}
